package com.cf.super_hero.controller;

import com.cf.super_hero.entity.Form;
import com.cf.super_hero.serve.impl.EnrollService;
import com.cf.super_hero.tools.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

//表示跨域设置
@CrossOrigin
@RestController
public class EnrollControl {
    @Autowired
    EnrollService enrollService;
    @PostMapping("/enroll")
    public Result enroll(@RequestBody Form form){
    /*
    表示注册API
     */
       Boolean is=enrollService.enroll(form);
       if(is){
           return Result.success("successful");
       }
       return Result.success("error");
    }
}
